<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
		<script type="text/javascript" src="../libs/jquery-1.4.4.js"></script>
		<script type="text/javascript">
			var useMessaging = false;
            var query = window.location.search.substring(1);

            if (query.indexOf("service") > -1) {
                useMessaging = true;
                window.addEventListener("message", calculate, false );
            }

			function calculate()
			{
				var message = "";
				var getal1 = parseInt($('#num1').val());
				var getal2 = parseInt($('#num2').val());

				message = (getal1 + getal2).toString();
				$("#content").text(message);

				if (useMessaging)
				{
					parent.getResult();
				}
			}
		</script>
    </head>
    <body>
		<form action="#">
			<input type="text" name="num1" id="num1" />
			<input type="text" name="num2" id="num2" />
			<input type="button" onclick="calculate(); return false;" value="Reken Uit!" />
		</form>
		<div id="content"></div>
    </body>
</html>